//
//  RNReload.m
//  hengqintong
//
//  Created by DYH on 2019/10/24.
//  Copyright © 2019 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RNReload.h"
#import <React/RCTBridge.h>

@interface RNReload()

@end

@implementation RNReload

@synthesize bridge = _bridge;

RCT_EXPORT_MODULE(RNReload)

- (void)loadBundle
{
  [_bridge reload];
}

RCT_EXPORT_METHOD(reload) {
  if ([NSThread isMainThread]) {
    [self loadBundle];
  } else {
    dispatch_sync(dispatch_get_main_queue(), ^{
      [self loadBundle];
    });
  }
  return;
}

@end

